﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BussinessSMS;
using System.Web.Services;
using DataAccessSMS;
using System.Web.Profile;


public partial class admin_Employees_list : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            List<DEGREE> degree = GetDegress();
            ddlDegree.DataSource = degree;
            ddlDegree.DataTextField = "Degree_Name";
            ddlDegree.DataValueField = "Degree_Id";
            ddlDegree.DataBind();

        }
    }
    public List<DEGREE> GetDegress()
    {
        return GetEmployeeObj().GetDegrees();
    }
    [WebMethod]
    public static string GetMaxEmpId()
    {
        long EmpId = GetEmployeeObj().GetMaxEmpId();
        return EmpId.ToString();
    }
    
    [WebMethod]
    public static List<Employee> GetEmployeesList()
    {
        return GetEmployeeObj().GetEmployeesList();
        
    }
    [WebMethod]
    public static void SaveEmployeeInfo(Employee EmpInfo,List<Employee_Qualification> EmpQualification)
    {
        GetEmployeeObj().SaveEmpInfo(EmpInfo, EmpQualification);
    }
    public static ProfileBase GetProfileBaseObj()
    {
        ProfileBase proBase = (ProfileBase)HttpContext.Current.Profile;
        return proBase;
    }
    public static Employees GetEmployeeObj()
    {
        Employees GeneralObj = new Employees(GetProfileBaseObj().GetPropertyValue("UserId").ToString(), GetProfileBaseObj().GetPropertyValue("SchoolID").ToString());
        return GeneralObj;
    }
}